//
//  Common.swift
//  HansWeibo
//
//  Created by Hans on 16/8/9.
//  Copyright © 2016年 Hans. All rights reserved.
//

import UIKit
//相当于OC中的PCH文件

// 切换根控制器的名字
let NSNOTIFICATIONCENTER = "NSNOTIFICATIONCENTER"

//微博账号
let WBName = "18706183707"
let WBPassWd = "hewenwei051409"

//微博相关信息
let WBAppKey = "1187233812"
let WBAppSecret = "61c768c7453969cf4bba6d3471edd7c4"
let WBRedirect_uri = "http://www.baidu.com"

// 屏幕的宽和高
let SCREENW = UIScreen.mainScreen().bounds.size.width
let SCREENH = UIScreen.mainScreen().bounds.size.height








//rgb颜色
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1)->UIColor{
    
    return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: alpha)
}


let AppTheneColor = UIColor.orangeColor()


func randomColor()-> UIColor {
    
    let r = CGFloat(random()%256)
    let g = CGFloat(random()%256)
    let b = CGFloat(random()%256)
    
    return RGB(r, green: g, blue: b)
}


/**
 自定义打印
 
 - parameter message:  内容
 - parameter file:     类名
 - parameter function: 方法名
 - parameter line:     行数
 */
func printLog<T>(message: T, file: String = __FILE__, function: String = __FUNCTION__,line: Int =  __LINE__){
    #if DEBUG
        let newFile = (file as NSString).lastPathComponent
        let result = "\(newFile) [\(line)] \(function) : \(message)"
        print(result)
    #endif
}





